<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style type="text/css"></style>
</head>
<body>
    <h1>XML DOM</h1>
    <hr>
    
    <img src="./imgs/Meinv001.jpg" width="600" height="300" title="美女001" id="myimg" loading="6666" data-img="12345">

    <script>
        // 获取属性
        console.log(myimg.src);
        console.log(myimg.getAttribute('src'));
        console.log(myimg.getAttributeNode('src').nodeValue);

        // console.log(myimg.data-img); // NO
        
        // console.log(myimg.loading); // NO
        console.log(myimg.getAttribute('loading'));
        console.log(myimg.getAttributeNode('data-img').nodeValue);

    </script>
</body>
</html>